/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.generate.service.GenerateService
   Module Description   :

   Date Created      : 2009/12/29
   Original Author   : feeling.wang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.generate.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import com.yaodian100.core.common.dao.impl.CommonCriteria;
import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.ec.generate.entity.EventImage;
import com.yaodian100.ec.generate.entity.GenerateAdvertise;
import com.yaodian100.ec.generate.entity.GenerateContent;
import com.yaodian100.ec.generate.entity.GeneratePosition;
import com.yaodian100.ec.generate.entity.ViewPmAdvertise;
import com.yaodian100.ec.generate.entity.ViewPromotionAdvertise;

/**
 * @author feeling.wang
 * 
 */
public interface GenerateService extends DomainService<GenerateAdvertise> {

	/**
	 * 全部分类 V2
	 * 
	 * @param date
	 * @return
	 * @throws CoreException
	 */
	public boolean generateCategoryIndexV2(String date) throws CoreException;

	/**
	 * 異動廣告狀態
	 * 
	 * @param adType
	 * @param idList
	 * @throws CoreException
	 */
	public void updateAdvStatus(String adType, List<Long> idList) throws CoreException, Exception;

	public void generateCateMainGoldAdv(String date) throws CoreException;

	/**
	 * 生成資料嵌入到活動頁面
	 */
	public boolean generateEventHtml(Map map, String fileName, String templateName) throws CoreException;

	/**
	 * 黄金四格V2
	 * 
	 * @param date
	 * @throws CoreException
	 * @throws Exception
	 */
	public void generateIdxGoldFourV2(String date) throws CoreException, Exception;

	/**
	 * 新版热销商品
	 * 
	 * @param date
	 * @throws CoreException
	 * @throws Exception
	 */
	public void generateIdxHotSaleV2(String date) throws CoreException, Exception;

	/**
	 * 产生首页大看版广告_V2
	 * 
	 * @param date
	 * @throws CoreException
	 */
	public void generateIdxMainGoldAdv_V2(String date) throws CoreException;

	public void generatePclMainGoldAdv_V2(String date) throws CoreException;

	/**
	 * 产生品牌折扣馆 - 厂商Banner
	 * 
	 * @throws CoreException
	 */
	public void generateOutletsBannerAdv() throws CoreException;

	/**
	 * 首页最新快报
	 * 
	 * @param date
	 * @throws CoreException
	 */
	public void generateIdxNews(String date) throws CoreException, Exception;

	/**
	 * Category index tab3
	 * 
	 * @throws CoreException
	 */
	public void generateIndexTab3(String date) throws CoreException;

	/**
	 * 右侧3tab V2
	 * 
	 * @param date
	 * @throws CoreException
	 */
	public void generateIndexTab3V2(String date) throws CoreException;

	/**
	 * 產生頁面導引頁
	 * 
	 * @throws CoreException
	 */
	public void generateNaviBar(String date) throws CoreException;

	/**
	 * 热销排行/最热评价
	 * 
	 * @param categoryId
	 * @param advTarget （作廢參數）
	 * @throws CoreException
	 * @throws Exception
	 */
	public void generateRightDownAdvV2(Long categoryId) throws CoreException, Exception;

	public void generateSearchbar_V2(String categoryId) throws CoreException;

	/**
	 * 產生頁面左邊選單
	 * 
	 * @throws CoreException
	 */
	public void generateSideBarMenu(String date) throws CoreException;

	/**
	 * 新版side bar
	 * 
	 * @param date
	 * @throws CoreException
	 */
	public void generateSideBarMenu2(String date) throws CoreException;

	/**
	 * 依条件查询广告资料
	 * 
	 * @param firstResult
	 * @param maxResults
	 * @param criteria
	 * @param sortOrder
	 * @return
	 * @throws CoreException
	 */
	public List<GenerateAdvertise> getGenerateAdvertiseList(int firstResult, int maxResults, CommonCriteria criteria,
			String[] sortOrder) throws CoreException;

	/**
	 * 依条件查询广告数量
	 * 
	 * @param criteria
	 * @return
	 * @throws CoreException
	 */
	public Number getGenerateAdvertiseSize(CommonCriteria criteria) throws CoreException;

	/**
	 * 依广告id查询广告内容资料
	 * 
	 * @param advId
	 * @return
	 */
	public List<GenerateContent> getGenerateContentByAdvId(Long advId) throws CoreException;

	/**
	 * 依条件查询广告内容
	 * 
	 * @param criteria
	 * @return
	 * @throws CoreException
	 */
	public List<GenerateContent> getGenerateContentList(CommonCriteria criteria) throws CoreException;

	/**
	 * 依广告id查询广告位置资料
	 * 
	 * @param advId
	 * @return
	 */
	public List<GeneratePosition> getGeneratePositionByAdvId(Long advId) throws CoreException;

	/**
	 * 依条件查询广告位置资料
	 * 
	 * @param firstResult
	 * @param maxResults
	 * @param criteria
	 * @param sortOrder
	 * @return
	 * @throws CoreException
	 */
	public List<GeneratePosition> getGeneratePositionList(CommonCriteria criteria) throws CoreException;

	/**
	 * 依条件查询广告位置数量
	 * 
	 * @param criteria
	 * @return
	 * @throws CoreException
	 */
	public Number getGeneratePositionSize(CommonCriteria criteria) throws CoreException;

	/**
	 * 依条件查询广告资料-pm
	 * 
	 * @param firstResult
	 * @param maxResults
	 * @param criteria
	 * @param sortOrder
	 * @return
	 * @throws CoreException
	 */
	public List<ViewPmAdvertise> getViewPmAdvertiseList(int firstResult, int maxResults, CommonCriteria criteria,
			String[] sortOrder) throws CoreException;

	/**
	 * 依条件查询广告数量-pm
	 * 
	 * @param criteria
	 * @return
	 * @throws CoreException
	 */
	public Number getViewPmAdvertiseSize(CommonCriteria criteria) throws CoreException;

	/**
	 * 依条件查询要promotion的广告资料
	 * 
	 * @param firstResult
	 * @param maxResults
	 * @param criteria
	 * @param sortOrder
	 * @return
	 * @throws CoreException
	 */
	public List<ViewPromotionAdvertise> getViewPromotionAdvertiseList(int firstResult, int maxResults,
			CommonCriteria criteria, String[] sortOrder) throws CoreException;

	/**
	 * 依条件查询要promotion的广告资料笔数
	 * 
	 * @param criteria
	 * @return
	 * @throws CoreException
	 */
	public Number getViewPromotionAdvertiseSize(CommonCriteria criteria) throws CoreException;

	public boolean isProductExist(String productId);

	/**
	 * 新增活动图型
	 * 
	 * @param eventImage
	 * @return
	 * @throws CoreException
	 */
	public EventImage saveEventImage(EventImage eventImage) throws CoreException;

	/**
	 * 新增广告名称、区间
	 * 
	 * @param generateAdvertise
	 * @return
	 * @throws CoreException
	 */
	public GenerateAdvertise saveGenerateAdvertise(GenerateAdvertise generateAdvertise) throws CoreException;

	/**
	 * 新增广告资料(3个entity同一个transtion)
	 * 
	 * @param generateAdvertise
	 * @param generatePosition
	 * @param generateContent
	 * @return
	 * @throws CoreException
	 */
	public boolean saveGenerateCombine(GenerateAdvertise generateAdvertise, GeneratePosition generatePosition,
			GenerateContent generateContent) throws CoreException;

	/**
	 * 新增广告内容
	 * 
	 * @param generateAdvertise
	 * @return
	 * @throws CoreException
	 */
	public GenerateContent saveGenerateContent(GenerateContent generateContent) throws CoreException;

	/**
	 * 新增广告位置
	 * 
	 * @param generateAdvertise
	 * @return
	 * @throws CoreException
	 */
	public GeneratePosition saveGeneratePosition(GeneratePosition generatePosition) throws CoreException;

	/**
	 * 修改广告名称、区间
	 * 
	 * @param generateAdvertise
	 * @return
	 * @throws CoreException
	 */
	public GenerateAdvertise updateGenerateAdvertise(GenerateAdvertise generateAdvertise) throws CoreException;

	/**
	 * 修改广告资料(3个entity同一个transtion)
	 * 
	 * @param generateAdvertise
	 * @param generatePosition
	 * @param generateContent
	 * @return
	 * @throws CoreException
	 */
	public boolean updateGenerateCombine(GenerateAdvertise generateAdvertise, GeneratePosition generatePosition,
			GenerateContent generateContent) throws CoreException;

	/**
	 * 修改广告内容
	 * 
	 * @param generateAdvertise
	 * @return
	 * @throws CoreException
	 */
	public GenerateContent updateGenerateContent(GenerateContent generateContent) throws CoreException;

	/**
	 * 修改广告 摆放位置
	 * 
	 * @param generateAdvertise
	 * @return
	 * @throws CoreException
	 */
	public GeneratePosition updateGeneratePosition(GeneratePosition generatePosition) throws CoreException;

	/**
	 * 馆长推荐V2
	 * 
	 * @param categoryId
	 * @return
	 * @throws CoreException
	 * @throws IOException
	 */
	public boolean generateCuratorRecommV2(Long categoryId) throws CoreException, IOException;

	/**
	 * 馆长推荐V3
	 * 
	 * @param categoryId
	 * @return
	 * @throws CoreException
	 * @throws IOException
	 */
	public boolean generateCuratorRecommV3(String categoryId) throws CoreException, IOException;

	/**
	 * 馆首页 - 热搜精选
	 * 
	 * @param categoryId
	 * @return
	 * @throws CoreException
	 * @throws IOException
	 */
	public boolean generateHotSelectV2(Long categoryId) throws CoreException, IOException;

	/**
	 * 馆首页 - 活动特辑
	 * 
	 * @param categoryId
	 * @return
	 * @throws CoreException
	 * @throws IOException
	 */
	public boolean generateSpecialAct(Long categoryId) throws CoreException, IOException;

	public boolean generateXMLforBaidu();

	public boolean generateDaphneCategoryIndex(String date) throws CoreException;

	/**
	 * 分類排行榜
	 */
	public void generateCategoryTopRank(String categoryIdString) throws CoreException, IOException;

	/**
	 * 品牌专区
	 * 
	 * @return
	 */
	public boolean generateBrandIndex(String date) throws CoreException, IOException;

	/**
	 * 類別促銷V3
	 * 
	 * @param date
	 * @throws CoreException
	 */
	public void generateIdxMidBoxAdv_V3(String date) throws CoreException;

	/**
	 * 首頁頭部通欄廣告
	 */
	public boolean generateIdxTopSpanAdv() throws CoreException, Exception;

	/**
	 * 首頁腰線廣告
	 */
	public boolean generateIdxWaistline() throws CoreException, Exception;

	/**
	 * 首頁右侧本周推荐
	 */
	public boolean generateIdxWeeklyRecommendAdv() throws Exception;

	/**
	 * 首頁右側小廣告1
	 */
	public boolean generateIdxRightSmall1() throws CoreException, Exception;

	/**
	 * 首頁右側小廣告2
	 */
	public boolean generateIdxRightSmall2() throws CoreException, Exception;

	/**
	 * 首頁雙拼廣告左
	 */
	public boolean generateIdxTwinLeft() throws CoreException, Exception;

	/**
	 * 首頁雙拼廣告右
	 */
	public boolean generateIdxTwinRight() throws CoreException, Exception;

	/**
	 * 首页圖片廣告（通欄廣告、腰線廣告、右側小廣告、雙拼廣告）。提供維護程式呼叫用。
	 */
	public boolean generateIdxImageAdv(String advType) throws Exception;

	public boolean generateIdxImageAdv(String advType, String advType2) throws Exception;

	/**
	 * 新版sideBar
	 * 
	 * @param date
	 * @throws CoreException
	 * @throws IOException
	 */
	public void generateSideBarMenu2New(String date) throws CoreException, IOException;

	/**
	 * @return
	 */
	public boolean generateXMLforFanli();

	/**
	 * 四头标
	 */
	public boolean generateTop4Tag() throws Exception;

	/**
	 * 热销商品
	 * 
	 * @return
	 */
	public boolean generaterIdxHotSaleV5() throws CoreException, Exception;

	public boolean generaterPclHotSaleV5() throws CoreException, Exception;

	/**
	 * 活动特辑
	 * 
	 * @return
	 */
	public boolean generaterIdxSpecialAct() throws CoreException, Exception;

	public boolean generaterPclSpecialAct() throws CoreException, Exception;

	/**
	 * 主题促销
	 * 
	 * @return
	 * @throws CoreException
	 * @throws Exception
	 */
	public boolean generaterIdxSaleV5() throws CoreException, Exception;

	public boolean generaterPclSaleV5() throws CoreException, Exception;

	/**
	 * 品牌推荐
	 * 
	 * @return
	 * @throws CoreException
	 * @throws Exception
	 */
	public boolean generaterIdxBrandRecommend() throws CoreException, Exception;

	public boolean generaterPclBrandRecommend() throws CoreException, Exception;
}
